This my latest assignment for this week and urgh i don't how to solve this.. I totally have no idea..
This is the QUESTION : Monty Hall problem - Simple English Wikipedia, the free encyclopedia
Here is my sketch for the whole problem.
imgur: the simple image sharer
This is where I'm at so far, what should I do next?
Code:
#include <stdio.h>
#include <stdlib.h> // rand() & srand() function
#include <time.h> // rand() & srand() function
#define MAX 3
int main(void){
int i, door[3] = { 0, 0, 0};
int car, initialPick;
srand(time(NULL));
for( i = 0 ; i < 10 ; i++ ){
car = rand()%MAX+1; // place the car at the start using random number generator
initialPick = rand()%MAX+1; // stimulate contestant initial pick using random generator
if ( rand()%2+1 = 1 ){
stays();
else
repick();
}
printf("\n");
}
printf("The number of games played are %d and %lf win", i, );
}